#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
int cmp(const void* n1, const void* n2)
{
	return *(int*)n2 - *(int*)n1;
}
int main()
{
	int n = 0;
	scanf("%d", &n);
	int* p = (int*)malloc(n * sizeof(int));
	int* p1 = (int*)malloc(n * sizeof(int));
	for (int x = 0; x < n; x++)
	{
		p1[x] = 1;
	}
	int c = 0;
	int i = 0;
	int j = 0;
	for (c = 0; c < n; c++)
	{
		scanf("%d", p + i);
		if (i > 0 && p[i] == p[i - 1] + 1)
			p1[j]++;
		else
			j++;
		i++;
	}
	qsort(p1, n, sizeof(int), cmp);
	printf("%d", p1[0]);
	free(p);
	free(p1);
	p = NULL;
	p1 = NULL;
	return 0;
}